//
//  UIViewController+log.m
//  Lesson109
//
//  Created by 徐盟 on 2023/3/7.
//

#import "UIViewController+log.h"
#import "XMLogger.h"
@implementation UIViewController (log)

-(XMLogger *)logger
{
    NSString * scopeName = NSStringFromClass(self.class);
    return  [XMLogger loggerWithScopeName:scopeName];
}


-(void) log:(NSString *) format,...
{
    
    va_list ap;
    va_start(ap, format);
    [self.logger logv:format args:ap];
    va_end(ap);
    
}
-(void (^)(NSString *format,...)) log
{
    return ^void(NSString *format,...){
        va_list ap;
        va_start(ap, format);
        [self.logger logv:format args:ap];
        va_end(ap);
    };
}
@end
